package com.blb.mapper;

import com.blb.pojo.BranchCompany;
import com.blb.pojo.PageEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *
 *
 */
@Repository
public interface BranchCompanyDao {
    int deleteByPrimaryKey(Integer branchId);

    int insert(BranchCompany record);

    int insertSelective(BranchCompany record);

    BranchCompany selectByPrimaryKey(Integer branchId);

    int updateByPrimaryKeySelective(BranchCompany record);

    int updateByPrimaryKey(BranchCompany record);

    /**
     * 查询行数
     * @return
     */
    int selectBranchCompanyCount();

    /**
     * 分页查询
     * @param start
     * @param length
     * @return
     */
    List<BranchCompany> selectBranchCompanyPage(@Param("start") int start, @Param("length") int length);

    /**
     * 通过ID查询单条数据
     *
     * @param branchId 主键
     * @return 实例对象
     */
    @Select("select * from branch_company where branch_id = #{branchId}")
    BranchCompany queryById(Integer branchId);

    /**
     * 查询指定行数据
     *
     * @return 对象列表
     */
    @Select("select * from branch_company")
    List<BranchCompany> queryAllByLimit();

    @Select("select location from branch_company GROUP BY location")
    List<String> queryLocation();
}